<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    body>div{
      width: 200px;
      border: 1px solid red;
      /*当元素的所有子元素全部浮动后,元素自动识别的内容高度为0,
      这样会导致后面的元素顶上来,最终呈现出显示异常的效果,
      给元素添加overflow:hidden*/
      overflow: hidden;
    }
    #d1{
      width: 50px;height: 50px;background-color: red;
      float: left;
    }
    #d2{
      width: 50px;height: 50px;background-color: green;
      float: left;
    }
    #d3{
      width: 50px;height: 50px;background-color: blue;
      float: left;
    }
    ul{
      list-style-type: none;
      padding:0;
      overflow: hidden;
    }
    li{
      float: left;
      margin-right: 10px;
    }
    p{
      width: 300px;
      height: 100px;
      background-color: yellow;
    }
  </style>
</head>
<body>
<div>
  <div id="d1"></div>
  <div id="d2"></div>
  <div id="d3"></div>
</div>
<ul>
  <li><a href="">首页</a></li>
  <li><a href="">免费课</a></li>
  <li><a href="">直播课</a></li>
  <li><a href="">精品课</a></li>
  <li><a href="">线上班</a></li>
</ul>
<p>
abc
</p>
</body>
</html>